package businesslogic.courseBl;

import java.rmi.Naming;
import java.util.ArrayList;

import vo.courseVO.CourseVO;
import businesslogicservice.courseblservice.CourseBLService;
import dataservice.ResultMessage;
import dataservice.courseDataService.CourseDatabaseService;

public class CourseController implements CourseBLService {

	
	CourseBLService course;
	private String userID;
	
	
	public CourseController(String userID) {
		this.userID = userID;
		course = new Course(userID);
	}

	@Override
	public ResultMessage addCourse(CourseVO newCourse) throws Exception{
		// TODO Auto-generated method stub
		return course.addCourse(newCourse);
	}

	@Override
	public ResultMessage updateCourse(CourseVO courseVO)throws Exception {
		// TODO Auto-generated method stub
		return course.updateCourse(courseVO);
	}

	@Override
	public CourseVO getCourse(String courseId)throws Exception {
		// TODO Auto-generated method stub
		return course.getCourse(courseId);
	}

	@Override
	public ArrayList<CourseVO> getAllCourse()throws Exception {
		// TODO Auto-generated method stub
		return course.getAllCourse();
	}

	public ArrayList<CourseVO> getSelectableCourses()throws Exception {
		return course.getSelectableCourses();
	}

	public ArrayList<CourseVO> getSelectableCourse(String departmentID)throws Exception{
		return course.getSelectableCourse(departmentID);
	}
	
	public ArrayList<CourseVO> getMyCourse()throws Exception{
		return course.getMyCourse();
	}

	public ArrayList<String> getAllDepartments() throws Exception{

		return course.getAllDepartments();

	}
	
	public ArrayList<CourseVO> getCourseByDepartments(String departmentID)throws Exception{
		return course.getCourseByDepartments(departmentID);
	}

}
